#include "widget.h"
#include "ui_widget.h"
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}



void Widget::on_pushButton_up_clicked()
{
    QRect ret = ui->pushButton_target->geometry();
    qDebug()<<ret;
//    ret.setX(ret.y()-5);
//    ui->pushButton_target->setGeometry(ret);

    ui->pushButton_target->setGeometry(ret.x(),ret.y()-5,ret.width(),ret.height());
}

void Widget::on_pushButton_down_clicked()
{
    QRect ret = ui->pushButton_target->geometry();
    qDebug()<<ret;
//    ret.setX(ret.y()+5);
//    ui->pushButton_target->setGeometry(ret);

    ui->pushButton_target->setGeometry(ret.x(),ret.y()+5,ret.width(),ret.height());
}

void Widget::on_pushButton_left_clicked()
{
    QRect ret = ui->pushButton_target->geometry();
    qDebug()<<ret;
//    ret.setY(ret.x()-5);
//    ui->pushButton_target->setGeometry(ret);
    ui->pushButton_target->setGeometry(ret.x()-5,ret.y(),ret.width(),ret.height());
}

void Widget::on_pushButton_right_2_clicked()
{
    QRect ret = ui->pushButton_target->geometry();
    qDebug()<<ret;
//    ret.setY(ret.x()+5);
//    ui->pushButton_target->setGeometry(ret);
    ui->pushButton_target->setGeometry(ret.x()+5,ret.y(),ret.width(),ret.height());
}
